package com.zhangpf.boot.entity;

import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import lombok.Data;

@Data
@Document("student")
public class Student {

	@Id
	private String id;
	
	@Indexed
	private String name;
	
	private Integer age;
	
	private String addr;
	
	private ObjectId teacherId;
	
	@DBRef
	private Teacher teacher;
}
